package com.fiberhome.nas.core.database

import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.fiberhome.nas.core.database.dao.UploadTaskDao
import com.fiberhome.nas.core.database.entity.UploadTaskEntity
import com.fiberhome.nas.core.database.entity.UploadTaskStatusConverter

/**
 * 应用数据库
 */
@Database(
    entities = [
        UploadTaskEntity::class
    ],
    version = 1,
    exportSchema = false
)
@TypeConverters(UploadTaskStatusConverter::class)
abstract class AppDatabase : RoomDatabase() {

    /**
     * 获取上传任务DAO
     */
    abstract fun uploadTaskDao(): UploadTaskDao


    companion object {
        const val DATABASE_NAME = "nas-database"
    }
}